<?php
	require_once(realpath(dirname(__FILE__)) . "/Baseobj.class.php");
	require_once(realpath(dirname(__FILE__)) . "/Produit.class.php");
	require_once(realpath(dirname(__FILE__)) . "/Contenu.class.php");
	require_once(realpath(dirname(__FILE__)) . "/Rubrique.class.php");
	require_once(realpath(dirname(__FILE__)) . "/Dossier.class.php");


	class Reecriture extends Baseobj{

		var $id;
		var $fond;
		var $url;
		var $param;
		var $lang;
		var $actif;

		const TABLE="reecriture";
		var $table=self::TABLE;

		var $bddvars = array("id", "fond", "url", "param", "lang", "actif");

		function __construct($url=""){
			parent::__construct();

			if($url != "")
 			  $this->charger($url);
		}

		function charger($url){
			return $this->getVars("select * from $this->table where url=\"$url\"");
		}

		function charger_id($id){
		     return $this->getVars("select * from $this->table where id=\"$id\"");
		}

		function charger_param($fond, $param, $lang=1, $actif=1){
		     return $this->getVars("select * from $this->table where fond=\"$fond\" and param=\"$param\" and lang=\"$lang\" and actif=\"$actif\"");
		}
	}
?>